
package processing;

import java.util.Stack;

import model.semantics.AbstractToken;
import model.semantics.punctuation.LeftParenthesesToken;

/**
 * Processor class for separators (commas). Used to processes tokens via reflection.
 * @author Troy Ferrell
 *
 */
public class SeparatorTokenProcessor extends AbstractTokenProcessor 
{

	@Override
	public void process(AbstractToken token, Stack<AbstractToken> operators,
			Stack<AbstractToken> operands) 
	{
		while (!operators.empty() && !(operators.peek() instanceof LeftParenthesesToken))
				//!operators.peek().equals(LEFT_PAREN)) 
		{
			operands.add(operators.pop());
		}
		
	}
}
